package com.vne.skyemart.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.vne.skyemart.dao.StatusDao;
import com.vne.skyemart.model.Status;
import com.vne.skyemart.service.StatusService;

@Service("statusService")
@Transactional(propagation = Propagation.SUPPORTS,readOnly = true)
public class StatusServiceImpl implements StatusService{
	@Autowired
	private StatusDao statusDao;

	public StatusDao getStatusDao() {
		return statusDao;
	}

	public void setStatusDao(StatusDao statusDao) {
		this.statusDao = statusDao;
	}
	public StatusServiceImpl() {}
	@Transactional(propagation = Propagation.SUPPORTS,readOnly = false)
	@Override
	public void addStatus(Status status) {
		statusDao.save(status);
	}

	@Override
	public List<Status> listStatus() {
		return statusDao.findAll();
	}
	
}
